using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.IO;
using System.Windows.Forms;

namespace ClipboardProject
{
    public partial class Form3 : Form
    {
        public Form3()
        {
            InitializeComponent();
        }

        private void Form3_Load(object sender, EventArgs e)
        {
           
            this.listBox1.SelectedIndex = 1;       
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Clipboard.SetData(DataFormats.StringFormat, listBox1.SelectedItem);
        }

        private void button2_Click(object sender, EventArgs e)
        {
            
            if (Clipboard.ContainsData(DataFormats.StringFormat))
              listBox2.Items.Add((String)
                    Clipboard.GetData(DataFormats.StringFormat));
            else
                listBox2.Items.Add( "Object not found in Clipboard");
        }

        private void button3_Click(object sender, EventArgs e)
        {
            Clipboard.Clear();
        }
    }
}